// Problem 5: Smallest multiple
// 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
// What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

package main

import (
	"fmt"
	"projecteuler/euler"
)

func p005() int {
	ans := 2520
	for m := 11; m <= 20; m++ {
		if euler.IsPrime(m) {
			ans *= m
		} else {
			ans *= m / euler.GCD(ans, m)
		}
	}
	fmt.Println("Problem 005:", ans)
	return ans
}
